<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./node_modules/vue/dist/vue.min.js"></script>
</head>
<body>
    <div id="app">
        app
        <hr>
        <button @click="show=true">显示</button>
        <button @click="show=false">隐藏</button>
        <h1 v-if="show">斗破苍穹</h1>
        <h1 v-if="!show">数据结构</h1>
        <hr>
        <ul>
            <li v-for="el in users" v-if="el.gender=='女'">
                id={{el.id}},name={{el.name}},
                性别：{{el.gender}},age={{el.age}}
            </li>
        </ul>
    </div>
    <script>
        const app = new Vue({
            el:"#app",
            data:{
                show:false,
                users:[ //此数据一般是通过vue请求java后台接口获取
                    {id:1,name:'柳岩', gender:'女', age: 21},
                    {id:2,name:'苍老师', gender:'女', age: 18},
                    {id:3,name:'鲁迅', gender:'男', age: 24},
                    {id:4,name:'刘亦菲', gender:'女', age: 18},
                    {id:5,name:'周树人', gender:'男', age: 25}
                ]
            }
        })
    </script>
</body>
</html>